package com.ssm.Service;

import com.ssm.Dao.UserDao;

public class UserService {

    //1、判断注册的用户名是否存在
    public boolean register(String name,String password,String email){
        UserDao userDao=new UserDao();
        Boolean register=false;
        boolean checkUser = userDao.checkUser(name);
        //    2、如果不存在，存数据库
        if(checkUser){
            register = userDao.register(name, password, email);
        }
        return register;
    }

    //    2、登录判断
    public boolean register(String name,String password){
        UserDao userDao=new UserDao();
        boolean checkUser = userDao.checkUser(name,password);

        return checkUser;
    }

    //登录

}
